import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
	  // 保存用户的openid 和session_key
	  userData: {},
	  // 保存token
	  token: "",
	  UserInfo: {}
  },
  mutations: {
	  // 同步获取用户openid
	  getopenid: (state, data) => {
		  state.userData = data
	  },
	  // 获取token
	  getToken: (state, token) => {
		  state.token = token
	  },
	  // 保存用户信息
	  getUserInfo: (state, data) => {
		  state.UserInfo = data
	  },
  },
  actions: {},

});
